// api统一接口管理
import { fetchPost, fetchGet } from "../utils/https";

/**
 * @param {string} params
 * 我们定义了一个topics方法
 * 这个方法有一个参数params
 * params是我们请求接口时携带的参数对象
 * 而后调用了我们封装的post方法
 * post方法的第一个参数是我们的接口地址
 * 第二个参数是topics的params参数
 * 即请求接口时携带的参数对象
 * 最后通过export导出topics。
 */

// 获取验证码
export const captchaImage = (params) => fetchGet("/captchaImage", params);
// 干部之家接口
export const commonApi = (params) =>
  fetchPost("/m.api", JSON.stringify(params));
// 指标列表
export const quotaList = (params) =>
  fetchPost("/quotaMaintainAdmin/list", JSON.stringify(params));
// 新建指标
export const creatQquota = (params) =>
  fetchPost("/quotaMaintainAdmin/create", JSON.stringify(params));
// 编辑指标
export const updateQquota = (params) =>
  fetchPost("/quotaMaintainAdmin/update", JSON.stringify(params));
// 责任人列表
export const employeeList = (params) =>
  fetchPost("/quotaEmployeeAdmin/list", JSON.stringify(params));
// 获取负责人指标列表
export const getQuotaByEmpId = (params) =>
  fetchGet("/quotaEmployeeAdmin/getQuotaByEmpId", params);
// 查询指标是否有领导人
export const isRelate = (params) =>
  fetchGet("/quotaEmployeeAdmin/isRelate", params);
// 保存责任人
export const saveEmployee = (params) =>
  fetchPost("/quotaEmployeeAdmin/updateEmpQuota", JSON.stringify(params));
// 重点指标
export const quotaRecordList = (params) =>
  fetchPost("/quotaRecord/list", JSON.stringify(params));
// 重点指标下载模板
export const getModelUrl = (params) =>
  fetchGet("/quotaRecord/getModelUrl", params);
// 依据位次获取牌色
export const getSignage = (params) =>
  fetchPost("/quotaRecord/getSignage", JSON.stringify(params));
// 更新重点指标
export const updateQuota = (params) =>
  fetchPost("/quotaRecord/update", JSON.stringify(params));
// 异常反馈
export const abnormalList = (params) =>
  fetchPost("/abnormalFeedbackManage/page", JSON.stringify(params));
// 更新异常反馈
export const updateAbnormal = (params) =>
  fetchPost("/abnormalFeedbackManage/update", JSON.stringify(params));
// 异常反馈
export const platformlList = (params) =>
  fetchPost("/platformFeedbackManage/page", JSON.stringify(params));
// 更新异常反馈
export const updatePlate = (params) =>
  fetchGet("/platformFeedbackManage/deal", params);
// 通知列表
export const noticeList = (params) =>
  fetchPost("/notification/page", JSON.stringify(params));
// 通知详情
export const noticeDetail = (params) =>
  fetchPost("/notification/detail", JSON.stringify(params));
// 通知新增
export const noticeAdd = (params) =>
  fetchPost("/notification/insert", JSON.stringify(params));
// 通知编辑
export const noticeEdit = (params) =>
  fetchPost("/notification/update", JSON.stringify(params));
// 通知发送
export const noticeSend = (params) =>
  fetchPost("/notification/issue", JSON.stringify(params));
// 通知人列表
export const empList = (params) =>
  fetchPost("/employeeManage/list", JSON.stringify(params));
export const emppage = (params) =>
  fetchPost("/employeeManage/page", JSON.stringify(params));
// 重点关注任务
export const getMarketList = (params) =>
  fetchPost("/dutiesAdmin/page", JSON.stringify(params));

// 人员列表
export const personList = (params) =>
  fetchGet("/employeeInfo/getadCreDept", JSON.stringify(params));
// 告警列表
export const warnList = (params) =>
  fetchGet("/quotaNotifySetting/list", JSON.stringify(params));
// 告警保存
export const warnSave = (params) =>
  fetchPost(
    "/quotaNotifySetting/updateQuotaNotifySettingById",
    JSON.stringify(params)
  );
// 两次红牌
export const twiceRed = (params) =>
  fetchPost("/quotaNotifySend/twiceRed", JSON.stringify(params));
// 三次红牌
export const threeRed = (params) =>
  fetchPost("/quotaNotifySend/threeRed", JSON.stringify(params));
// 一次红牌/绿牌
export const once = (params) =>
  fetchPost("/quotaNotifySend/once", JSON.stringify(params));
// 名次变动
export const changePosition = (params) =>
  fetchPost("/quotaNotifySend/positionChange", JSON.stringify(params));

// 自主申报  区域列表
export const areaList = (params) =>
  fetchPost("/area/page", JSON.stringify(params));
// 自主申报  申报列表
export const declareList = (params) =>
  fetchPost("/declarationManage/page", JSON.stringify(params));

// 重点关注任务  批示任务  列表
export const taskList = (params) =>
  fetchPost("/dutyManage/getDutyMainByParam", JSON.stringify(params));
// 重点关注任务  批示任务  新增
export const addTask = (params) =>
  fetchPost("/dutyManage/saveDutyMain", JSON.stringify(params));
// 重点关注任务  批示任务  编辑
export const editTask = (params) =>
  fetchPost("/dutyManage/editDutyMain", JSON.stringify(params));
// 重点关注任务  批示任务  下发
export const sendTask = (params) => fetchGet("/dutyManage/issueDuty", params);
// 重点关注任务  批示任务  撤回
export const backTask = (params) =>
  fetchGet("/dutyManage/recallDutyMain", params);
// 重点关注任务  子任务  查询
export const treeTask = (params) =>
  fetchGet("/dutyManage/getDutyItemTree", params);
// 重点关注任务  子任务  新增
export const addTree = (params) =>
  fetchPost("/dutyManage/saveDutyItem", JSON.stringify(params));
// 重点关注任务  子任务  删除
export const delTree = (params) => fetchGet("/dutyManage/deleteDuty", params);
// 重点关注任务  批示任务  所有人员列表
export const roleAllList = (params) =>
  fetchPost("/employeeManage/powerPage", params);
// 重点关注任务  批示任务  权限人员列表
export const roleList = (params) => fetchGet("/dutyManage/getAuthList", params);
// 重点关注任务  批示任务  保存人员列表
export const saveRoleList = (params) =>
  fetchPost("/dutyManage/saveAuthList", params);
export const deptList = (params) => fetchGet("/dingApp/deptList", "");
export const childDeptOrPeopleList = (params) =>
  fetchGet("/dingApp/childDeptOrPeopleList", params);
export const getByAccountId = (params) =>
  fetchGet("/userInfo/getByAccountId", params);
export const synUserInfo = (params) =>
  fetchPost("/userInfo/synUserInfo", params);
export const getPersonInfo = (params) =>
  fetchPost("/userInfo/pageList", params);
export const editUserInfo = (params) =>
  fetchPost("/userInfo/editUserInfo", params);
export const areaPrincipal = (params) =>
  fetchPost("/areaPrincipal/pageList", params);
export const getTreearea = (params) => fetchGet("/area/getTree", params);
export const editAreaPrincipal = (params) =>
  fetchPost("/areaPrincipal/edit", params);
export const addAreaPrincipal = (params) =>
  fetchPost("/areaPrincipal/add", params);

export const importQuotaRecord = (params) =>
  fetchPost("/quotaRecord/importQuotaRecord", params);
export const streetRecordPage = (params) =>
  fetchPost("/webStreetQuota/streetRecordPage", params);
export const periodNoList = (params) =>
  fetchGet("/webStreetQuota/periodNoList", params);

export const areaErrorData = (params) =>
  fetchPost("/areaErrorData/errorDataPage", params);
export const streetErrorData = (params) =>
  fetchPost("/streetErrorData/errorDataPage", params);

// 首页获取当日、当月及累计访问人数/人次
export const getDayTotalVisitors = (params) =>
  fetchGet("/BackendHome/getDayAndTotalVisitors", params);
// 获取指定日期内的日活
export const getPointDateVisitorsPv = (params) =>
  fetchGet("/BackendHome/getPointDateVisitorsPv", params);
// 获取指定日期内的月活
export const getPointMonthVisitorsPv = (params) =>
  fetchGet("/BackendHome/getPointMonthVisitorsPv", params);

export const getOperationLog = (params) => fetchPost("/log/page", params);
